package com.classloader;

/**
 * @author hong
 * @version 1.0
 * @description: 类加载顺序
 * @date 2022/4/16 16:13
 */
public class ClassLoaderSort {
    static {
        System.out.println("***************load ClassLoaderSort*****************");
    }

    public static void main(String[] args) {
        new A();
        System.out.println("**************load Test******************");
        B b = null; //B不会加载，除非这里执行 new B();
    }

    static class A{
        static {
            System.out.println("***************** load A**************************");
        }


        public A(){
            System.out.println("**********************inital A *****************");
        }
    }

    static class B{
        static{
            System.out.println("************************load b ***************************");
        }

        public B(){
            System.out.println("**************************inital B **********************");
        }
    }


}
